// scaup - Scala up!
// (c) 2008-2010, Normen Müller, normen.mueller@gmail.com  
// $Id: DOT.scala 78 2010-05-13 12:25:41Z normen.mueller $
package scaup.parsing.dot

import java.io.File
import java.text.MessageFormat.{format}

/** This object provides a simple interface to the DOT parser class.
 * 
 *  Restricitons:
 *  o 'port', 'compass_p', and records are not yet supported
 *  o Nested fields are not recognized as such,
 *    e.g. "struct3 [shape=record,label="hello\nworld |{ b |{c|<here> d|e}| f}| g | h"]"
 *
 *  @author <a href="mailto:normen.mueller@googlemail.com">Normen M&#xFC;ller</a>
 *  @version 0.0.4
 *
 *  @thanks to Ross Judson for his initial ideas regarding DOT parsing
 */
object DOTParser extends Parser {  
  
  def parse(input: String) = phrase(graph)(new lexical.Scanner(input)) match {
    case Success(result, _) => result
    case n@_                => error(format("DOT parsing error in\n{0}\n\n", input) + n)

  }
  
}
